//
//  DDVerifyThread.h
//  PrivateCloud
//
//  Created by mars on 13-10-16.
//  Copyright (c) 2013年 sarah doo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GCDAsyncSocket.h"
#import "DDHdrCloud.h"
//#import "DDConnectCallback.h"
#import "DDFileInfo.h"
#import "DDDealFileCallback.h"
#import "DDCloudInfo.h"
#import "DDDownLoadAddress.h"
#import "DDDownLoadAddressACK.h"
#import "DDConnectCompleteCallback.h"
#import "DDUploadBookComplete.h"
#import "DDCommentDic.h"
@interface DDVerifyThread : NSObject{
//    GCDAsyncSocket *sendSocket;
    DDHdrCloud* curHdr;
    NSString* myTokenMaskStr;
    NSString* pwd;
//    GCDAsyncSocket *sendSocket;
}


@property (nonatomic,retain)GCDAsyncSocket *sendSocket;
@property (nonatomic,retain)NSString* host;
@property (nonatomic,assign)int port;
@property (nonatomic,retain)DDHdrCloud* curHdr;
@property (nonatomic,retain)NSString* myTokenMaskStr;
@property (nonatomic,retain)NSString* pwd;
@property (nonatomic,retain)NSArray* uploadFileList;
@property (nonatomic,retain)id<DDDealFileCallback> dealFileCallback;
@property (nonatomic,retain)id<DDConnectCompleteCallback> connectDelegate;
@property (nonatomic,retain)id<DDUploadBookComplete> uploadBookCallback;
@property (nonatomic,retain)NSArray* currentDownloadList;
@property (nonatomic,retain)NSArray* currentUploadList;
//用于统计上传进度的变量
@property (nonatomic,assign)long totalLength;
@property (nonatomic,assign)long alreadyDownloadLength;
@property (nonatomic,assign)int currentPer;
@property (nonatomic,assign)BOOL uploadVcfFlag;


+ (DDVerifyThread*)sharedVerifyThread;

- (id)initWithHost:(NSString*)vhost port:(int)vport pwd:(NSString*)vpwd;

//- (id)initWithHost:(NSString*)host port:(int)port;

//开始连接服务器
- (void) connectToCloud:(DDCloudInfo*)cloudInfo andPassword:(NSString*) password;
//上报我方文件列表
-(void)reportFileList:(NSArray *)folderList;
//下载一系列文件
-(void)downFileList:(NSArray *)fileList;
//上传一个文件
-(void)uploadFile:(DDFileInfo *)fileInfo;
//用户发送一条指令
-(void)sendMessage:(DDHdrCloud* )msg;
//向PC端发送上传文件列表
-(void)uploadFileList:(NSArray*)fileList;
//向PC端发送通讯录文件
-(void)uploadAddressBook:(DDDownLoadAddress*)downloadAddress;
//向服务器发送下载通讯录的指令
-(void)downAddressBook;
//关闭本连接，并进行数据的清理
+(void)closeAndClead;

@end
